
<div :class="['g-table-layout', $store.state.appPrefix + '-p-org-index']" data-table-extra="10">
  <div class="g-table-header">
    <div class="g-table-header-wrap">
      <div class="g-table-header__title">企业管理</div>
      <div class="g-table-header__desc">运营人员快速添加企业，实现高效企业信息管理</div>
    </div>
    <div class="g-table-header__extra">
      <el-button type="primary" size="small" icon="el-icon-plus" @click="$handleAdd">添加企业</el-button>
    </div>
  </div>
  <div class="g-table-main">    
    <div class="g-table-top g-table-top-action__flex g-table-top-action__flex--br">
      <div class="g-table-top-action__left">
        <div class="g-table-main-title">企业列表</div>
      </div>
      <div class="g-table-top-action__right">
        <el-select
          class="g-table-top-action__left--block g-table-top-action__left--row"
          v-model="filterForm[FILTER_PARAMS.expiredStatus.interfaceParam]"
          placeholder="选择授权状态"
          clearable
          size="small"
          @change="$search">
          <el-option
            v-for="item in EXPIRED_STATUS"
            :key="item.codeNum"
            :label="item.codeName"
            :value="item.codeNum">
          </el-option>
        </el-select>
        <el-search
          size="small"
          v-model="filterForm[FILTER_PARAMS.orgTypeCode.interfaceParam]"
          class="g-table-top-action__left--block g-table-top-action__left--row"
          isBasic
          @search="$search"
          @clear="() => {filterForm[FILTER_PARAMS.orgTypeCode.interfaceParam] = ''; $search()}"
          placeholder="请输入企业码或企业名称查询">
        </el-search>
        <!-- <el-button type="primary" icon="el-icon-plus" @click="$handleAdd">新增</el-button> -->
      </div>
    </div>
    <el-table v-loading="isPageLoading" :height="tableHeight" :data="tableList">
      <el-table-column
        label="序号"
        type="index">
      </el-table-column>
      <el-table-column
        v-for="col in COL_INDEXS"
        :key="col.prop"
        :prop="col.interfaceParam"
        :label="col.label"
        show-overflow-tooltip
        :min-width="120">
        <template slot-scope="scope">
          <span v-if="col.isDict">
            <el-tag size="mini" :type="(EXPIRED_STATUS_SIMPLIFY[scope.row[col.prop]] || {}).tag">{{(EXPIRED_STATUS_SIMPLIFY[scope.row[col.prop]] || {}).codeName | filterBlank}}</el-tag>
          </span>
          <span v-else-if="col.prop === 'useLimit'">{{scope.row[col.prop] === '0' ? '无限制' : scope.row.deadlineTime | filterBlank}}</span>
          <span v-else-if="col.prop === 'authCount'">{{parseInt(scope.row[col.prop], 10) === 0 ? '无限制' : scope.row[col.prop] ? `${scope.row[col.prop]}人` : '' | filterBlank}}</span>
          <span v-else>{{scope.row[col.prop] | filterBlank}}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="操作"
        fixed="right"
        :width="200"
        class-name="no-ellipsis">
        <template slot-scope="scope">
          <div class="btns">
            <el-button type="text" size="medium" @click="$handleDetail(scope.row)">详情</el-button>
            <el-button type="text" size="medium" @click="$handleEdit(scope.row)">编辑</el-button>
            <el-button type="text" size="medium" @click="$handleDelete(scope.row)">删除</el-button>
            <el-button type="text" size="medium" @click="$loginEnterprise(scope.row)">登入</el-button>
          </div>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      class="g-table-bottom g-pagination"
      background
      :hide-on-single-page="true"
      :layout="PAGE_CONFIG.simpleLayout"
      :total="totalCount"
      :page-size="pageSize"
      :current-page.sync="pageNo"
      @current-change="$handlePageChange">
    </el-pagination>
  </div>
</div>
